import { Context } from "koa";
import * as userService from "../services/user";
import * as fn from "../utils/fn";

// 获取用户信息
export const getUserById = async (ctx: Context) => {
  const id = fn.toNumber(ctx.params.id);
  fn.checkIsDataId(id);
  return await userService.getUserById(id, ["id", "name"], true);
};
